import { BezierEdge, BezierEdgeModel } from '@logicflow/core'

class FlowLinkModel extends BezierEdgeModel {
  getEdgeStyle() {
    const style = super.getEdgeStyle()
    style.strokeWidth = 3
    style.stroke = this.isSelected || this.properties.isSelected ? '#ff7f0e' : '#d3d7de'
    return style
  }
}
class FlowLink extends BezierEdge {}

export default function register(lf) {
  let linkObj = {
    type: 'flow-link',
    view: FlowLink,
    model: FlowLinkModel,
  }
  lf.register(linkObj)
  lf.setDefaultEdgeType('flow-link') // 设置默认连线类型
}
